<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>基本列表</title>
    <script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
    <!-- 
        v-for指令：
            1.用于展示列表数据
            2.语法: v-for="(item,index) in xxx" :key="yyy"
            3.可遍历：数组、对象、字符串
    -->
    <div id="root">
        <h2>人员列表信息</h2>
        <ul>
            <li v-for="(p,index) in persions" :key="p.id">
                {{p.name}}-{{p.age}}
            </li>
        </ul>
    </div>

    <script>
        const vm = new Vue({
            el:"#root",
            data() {
                return {
                    persions:[
                        {id:'001',name:'张三',age:16},
                        {id:'002',name:'李四',age:15},
                        {id:'003',name:'王五',age:20},
                    ]
                }
            },
        })



    </script>
    
</body>
</html>